package com.dragonboat.exception;

import com.dragonboat.util.ResponseResult;
import com.dragonboat.util.ResponseResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ResponseResult<?> handleException(Exception e) {
        return ResponseResult.error(e.getMessage());
    }
}